home *** CD-ROM | disk | FTP | other *** search
-
- BCPL support functions (bcpl.e)
-
- © Richard Perrott 6th April 1995 FreeWare
- email: hcm94rp2@dmu.ac.uk
-
- This module contains the following functions:
-
- PROC bptr(bptr)
- PROC cptr(cptr)
- PROC bstr(bptr, dst=0, len=ALL)
- PROC bstrc(cptr, dst=0, len=ALL)
- PROC bstrCmp(bptr1, bptr2, len=ALL)
- PROC bstrCmpc(cptr1, cptr2, max=ALL)
-
-
- Usage:
-
- PROC bptr(bptr)
-
- converts a BPTR to a CPTR
-
-
- PROC cptr(cptr)
-
- converts a CPTR to a BPTR, if the CPTR is not on a longword
- boundary it does Raise("CPTR")
-
-
- PROC bstr(bptr:BPTR, dstring=NIL, len=ALL)
- PROC bstrc(cptr:CPTR, dstringt=NIL, len=ALL)
-
- Both PROCs convert a BSTR (BCPL string) into a C string.
- If an address is not provided for a destination string in
- dstring' then a string is allocated using String().
- Raise("MEM") is called if String() returns NIL.
-
-
- PROC bstrCmp(bptr1:BPTR, bptr2:BPTR, max=ALL)
- PROC bstrCmpc(cptr1:CPTR, cptr2:CPTR, max=ALL)
-
- Both PROCs compare a two BSTRs (BCPL strings).
- Only max chars are compared.
- Returns 0 if string1=string2
- Returns -1 if string1<string2
- Returns 1 if string1>string2
-
-
- Note:
- Any registers used by these routines are saved.
-
- The module contains 288 bytes of assembler / E code.
-
- All the routines will stay in a 68020+ code cache.
-
- The routine has been heavily tested, though there are no promises
- and I won't be held responsible if you find bugs or you misuse the
- routine.
-
- If you do find any bugs then please email me.
-